﻿using ST.Torch.WebApi.Core.Entities.System;
using ST.Torch.WebApi.Core.Entities.Utils;
using System.Linq.Expressions;


namespace ST.Torch.WebApi.Application.Utils.Services;

public interface IFormDataService
{
    #region curd
    IRepository<FormData> GetRepository();
    void Insert(FormData entity);


    Task InsertAsync(FormData entity, string[] Includes = null);

    void Update(FormData entity, string[] Includes = null);

    Task UpdateAsync(FormData entity, string[] Includes = null);

    void Delete(FormData entity, bool IsSoft = false);

    Task DeleteAsync(FormData entity, bool IsSoft = false);
    bool Any(Expression<Func<FormData, bool>> predicate);


    Task<bool> AnyAsync(Expression<Func<FormData, bool>> predicate);

    FormData Single(Expression<Func<FormData, bool>> predicate, bool tracking = false);

    Task<FormData> SingleAsync(Expression<Func<FormData, bool>> predicate, bool tracking = false);

    List<FormData> Query(Expression<Func<FormData, bool>> predicate, bool tracking = false);

    Task<List<FormData>> QueryAsync(Expression<Func<FormData, bool>> predicate, bool tracking = false);


    PagedList<FormData> QueryPage(Expression<Func<FormData, bool>> predicate, PageReq page, bool tracking = false);

    Task<PagedList<FormData>> QueryPageAsync(Expression<Func<FormData, bool>> predicate, PageReq page, bool tracking = false);





    #endregion
}
